package top.shen33.yang.services.impl;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import top.shen33.yang.model.entity.MetaTables;
import top.shen33.yang.mapper.MetaTablesMapper;
import top.shen33.yang.services.MetaTablesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author oreilly
 * @since 2018-08-23
 */
@Service
public class MetaTablesServiceImpl extends ServiceImpl<MetaTablesMapper, MetaTables>implements MetaTablesService {


    @Override
    public Class clazz() {
        return null;
    }

    @Override
    public void doAdd(MetaTables itemMetaTables) {

        itemMetaTables.insertOrUpdate();
    }

    @Override
    public void doUpdate(MetaTables itemMetaTables) {

        itemMetaTables.insertOrUpdate();
    }

    @Override
    public void doDelete(String[] ids) {

        QueryWrapper<MetaTables> ew = new QueryWrapper<>();
        ew.in("sid", ids);
        new MetaTables().delete(ew);
    }


    @Override
    public List<MetaTables> all(MetaTables itemMetaTables) {

        return this.baseMapper.all(itemMetaTables);
    }

    @Override
    public void doImport(List<MetaTables> dataList) {

    }

    @Override
    public MetaTables getOne(String id) {
        return getById(id);
    }


    @Override
    public Page<MetaTables> pageInfo(Page page, MetaTables itemMetaTables) {

        List<MetaTables> dataList = this.baseMapper.pageInfo(page, itemMetaTables);
        page.setRecords(dataList);
        return page;
    }

}
